package com.ruifu.pls.utils;

import com.ruifu.pls.model.test.CarnumParams;
import com.ruifu.pls.model.GLCallInputParam;
import com.ruifu.pls.model.test.ParseJson;

import java.io.IOException;
import java.io.UnsupportedEncodingException;

/**
 * ********************************************************
 * * @desc  ：
 * * @author  ${user}
 * * @date    ${date}
 * * @version v1.0
 * * ${tags}
 * *******************************************************
 */
public class HttpTest {

    public static  void main(String[]args){
        CarnumParams carnumParams = new CarnumParams();
        carnumParams.setCarnum("\\u4eacA09999");
        GLCallInputParam glCallInputParam = new GLCallInputParam();
        try {
            glCallInputParam.setData(ParseJson.parse(carnumParams));
            glCallInputParam.setMethod("g2matrix.commodities.creategoods");
            glCallInputParam.setMd5Sigh(SighUtil.getMD5(SighUtil.signParam(glCallInputParam).replace("\\\\","\\")));
            try {

                String s=HttpUtils.doPost("http://demo.api.g2link.cn:8081/","router",glCallInputParam.toString().replace("\\\\","\\"));//
            } catch (IOException e) {
                e.printStackTrace();
            }
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
    }

}
